﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ProductCollector;
using ThemeCupid.FrontEnd.Logic;

namespace ThemeCupid.FrontEnd
{
    public partial class AddToCart : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string rawId = Request.QueryString["productId"];
            if (rawId != null)
            {
                var objProduct = Product.Deserialize(rawId);
                var usersShoppingCart = new ShoppingCartAction();
                usersShoppingCart.AddToCart(objProduct);
                Response.Redirect("ShoppingCart.aspx");
            }
        }
    }
}